package com.oa.common.vo;

import com.oa.common.enums.apps.FromFileType;
import com.oa.entities.flows.Form;

import java.io.Serializable;
import java.util.List;

/**
 * @name 表单的返回类
 * @author Yang
 * @date 2018-07-12
 * @version 1.0.1
 */
public class FormVo implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = -1721832042089909168L;

    /** 表单的id **/
    private Long id;

    private String name;

    /** 表单的名称 **/
    private String inputName;

    /** 表单的类型 **/
    private int inputType;

    /** 流程的id **/
    private Long typeId;

    private String inputValue;

    private List<String> options;

    /** 宽 **/
    private String width;

    /** 高 **/
    private String height;

    private String type;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getInputName() {
        return inputName;
    }

    public void setInputName(String inputName) {
        this.inputName = inputName;
    }

    public int getInputType() {
        return inputType;
    }

    public void setInputType(int inputType) {
        this.inputType = inputType;
    }

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    /**
     * 根据表单初始化返回类
     *
     * @param form
     */
    public FormVo(Form form){
        this.id= form.getId();
        this.inputName= form.getInputName();
        this.inputType= form.getInputType();
        this.typeId= form.getTypeId();
        this.options=form.getOptiones();
        this.inputValue= form.getInputValue();
        this.height= form.getH();
        this.width= form.getW();
        this.name= form.getName();
        this.type=FromFileType.getMessage(form.getFileType());
    }


    public List<String> getOptions() {
        return options;
    }

    public void setOptions(List<String> options) {
        this.options = options;
    }

    public String getInputValue() {
        return inputValue;
    }

    public void setInputValue(String inputValue) {
        this.inputValue = inputValue;
    }

    public String getWidth() {
        return width;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public String getHeight() {
        return height;
    }

    public void setHeight(String height) {
        this.height = height;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "FormVo{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", inputName='" + inputName + '\'' +
                ", inputType=" + inputType +
                ", typeId=" + typeId +
                ", inputValue='" + inputValue + '\'' +
                ", options=" + options +
                ", width='" + width + '\'' +
                ", height='" + height + '\'' +
                '}';
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public FormVo(){

    }


}
